package com.atguigu.springcloud;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.ConfigurableEnvironment;

/**
 * @ClassName : com.atguigu.springcloud.OpenFeignClient80
 * @Description : 类描述
 * Created by cyd on 2021-10-05 20:14:50
 */
// 不要自动配置数据库连接
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
@EnableEurekaClient
@EnableFeignClients  // 激活openFeign
public class OpenFeignClient80 {
    private static ConfigurableApplicationContext context;

    public static void main(String[] args) {
        context = SpringApplication.run(OpenFeignClient80.class, args);
        System.out.println("--------------项目启动了---------------");
        ConfigurableEnvironment environment = context.getEnvironment();
        String port = environment.getProperty("server.port");
        System.out.println(port);
        System.out.println("http://localhost:" + port + "/consumer/payment/get/1");
    }
}
